package com.heima.user.controller;


import com.heima.user.model.common.dtos.ApUserDto;
import com.heima.user.model.common.dtos.LoginDto;
import com.heima.user.model.common.dtos.ResponseResult;
import com.heima.user.service.IApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * APP用户信息表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-06-25
 */
@RestController
@RequestMapping("/api/v1/login")
public class ApUserController {

    @Autowired
    private IApUserService apUserService;

    @PostMapping("/login_auth")
    public ResponseResult loginAuth(@RequestBody LoginDto dto){
        return apUserService.loginAuth(dto);
    }


    @PostMapping("/logout")
    public ResponseResult register(@RequestBody ApUserDto dto){
        return apUserService.register(dto);
    }

}
